﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using DataInfo;
using XBLib.Dal;
using XBLib.Dal.AdoDal;
using XBLib.BusinessObject;
using System.Data.Common;
using KenLib.BusinessObject;

namespace KenLib.Dal
{
    public class 応募会社履歴情報Dao : BaseAdoDao
    {
        #region Thanh Dong
        public DataTable frmJ_TraineeWorkedCompInput_SelectByID(int id)
        {
            DbParameter dbParamter1 = _daoHelper.CreateParameter("@ID", id, DbType.Int32);
            DbCommand dbcomman = _daoHelper.CreateCommand(CommandNameManager.sp_frmJ_TraineeWorkedCompInput_SelectByID_Dong, CommandType.StoredProcedure, dbParamter1);
            return _daoHelper.Query(dbcomman);
        }

        public int frmJ_TraineeWorkedCompInput_Insert(応募会社履歴情報 _応募会社履歴情報)
        {
            DbParameter dbParam1 = _daoHelper.CreateParameter("@会社名", _応募会社履歴情報.会社名, DbType.String);
            DbParameter dbParam2 = _daoHelper.CreateParameter("@部門名", _応募会社履歴情報.部門名, DbType.String);
            DbParameter dbParam3 = _daoHelper.CreateParameter("@仕事内容", _応募会社履歴情報.仕事内容, DbType.String);
            DbParameter dbParam4 = _daoHelper.CreateParameter("@主な実績", _応募会社履歴情報.主な実績, DbType.String);
            DbParameter dbParam5 = _daoHelper.CreateParameter("@開始年月日", _応募会社履歴情報.開始年月日, DbType.DateTime);
            DbParameter dbParam6 = _daoHelper.CreateParameter("@終了年月日", _応募会社履歴情報.終了年月日, DbType.DateTime);
            DbParameter dbParam7 = _daoHelper.CreateParameter("@応募情報ID", _応募会社履歴情報.応募情報ID, DbType.Int32);
            DbParameter dbParam8 = _daoHelper.CreateParameter("@廃止区分", _応募会社履歴情報.廃止区分, DbType.Int32);
            DbParameter dbParam9 = _daoHelper.CreateParameter("@企業ID", _応募会社履歴情報.企業ID, DbType.Int32);
            DbCommand command = _daoHelper.CreateCommand(CommandNameManager.sp_frmJ_TraineeWorkedCompInput_Insert_Dong, CommandType.StoredProcedure, dbParam1, dbParam2, dbParam3, dbParam4, dbParam5, dbParam6, dbParam7, dbParam8, dbParam9);
            return _daoHelper.Execute(command);
        }


        public int frmJ_TraineeWorkedCompInput_Update(応募会社履歴情報 _応募会社履歴情報)
        {
            DbParameter dbParam0 = _daoHelper.CreateParameter("@ID", _応募会社履歴情報.ID, DbType.Int32);
            DbParameter dbParam1 = _daoHelper.CreateParameter("@会社名", _応募会社履歴情報.会社名, DbType.String);
            DbParameter dbParam2 = _daoHelper.CreateParameter("@部門名", _応募会社履歴情報.部門名, DbType.String);
            DbParameter dbParam3 = _daoHelper.CreateParameter("@仕事内容", _応募会社履歴情報.仕事内容, DbType.String);
            DbParameter dbParam4 = _daoHelper.CreateParameter("@主な実績", _応募会社履歴情報.主な実績, DbType.String);
            DbParameter dbParam5 = _daoHelper.CreateParameter("@開始年月日", _応募会社履歴情報.開始年月日, DbType.DateTime);
            DbParameter dbParam6 = _daoHelper.CreateParameter("@終了年月日", _応募会社履歴情報.終了年月日, DbType.DateTime);
            DbParameter dbParam7 = _daoHelper.CreateParameter("@応募情報ID", _応募会社履歴情報.応募情報ID, DbType.Int32);
            DbParameter dbParam8 = _daoHelper.CreateParameter("@企業ID", _応募会社履歴情報.企業ID, DbType.Int32);
            DbCommand command = _daoHelper.CreateCommand(CommandNameManager.sp_frmJ_TraineeWorkedCompInput_Update_Dong, CommandType.StoredProcedure, dbParam0, dbParam1, dbParam2, dbParam3, dbParam4, dbParam5, dbParam6, dbParam7, dbParam8);
            return _daoHelper.Execute(command);
        }
        #endregion
    }
}
